<?php defined('SYSPATH') OR die('No direct access allowed.');

class Master_Search_Controller extends Controller 
{
	
	public $template;
	public $content;
	
	protected $main_menu;
	protected $sub_menu;
	protected $title;
	
	public $user;
	
	public function __construct() {
		parent::__construct();

		$auth=new Auth;
		$this->user = $auth->get_user();
		
		$view = new View('index');
		$view->header = new view('general/header');
		$view->content = $this->content;
		$view->footer = new view('general/footer');
		$view->header->title = $this->title;
		
		$menu = Kohana::lang('menu');
		$this->main_menu = $menu['main_menu'];
		
		$auth = new Auth();

		if ($auth->logged_in()) {
			$this->sub_menu = $menu['search_member_menu'];
		}
		else {
			$this->sub_menu = $menu['search_menu'];
		}
		
		$view->header->main_menu = $this->main_menu;
		$view->header->sub_menu = $this->sub_menu;
		$view->header->sub_nav = 'Search Navigation';
		$view->footer->main_menu = $this->main_menu;
		$this->template = $view;
		
	}
	
	protected function set_title($title)
	{
		$this->template->header->title = $title;
	}
	
	protected function set_main_menu($main_menu)
	{
		$this->template->header->main_menu = $main_menu;
	}
	
	protected function set_sub_menu($sub_menu)
	{
		$this->template->header->sub_menu = $sub_menu;
	}
	
}
